#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    Point(int x, int y)
    :_x(x)
    ,_y(y)
    {

    }

    void print(){
        cout << "Point::print()" << endl;
    }

    void display(){
        cout << _x << ":" << _y << endl;
    }

private:
    int _x;
    int _y;
};


void test(){
    Point * pt = new Point(1, 2);
    pt->print();
    pt->display();
    //上述代码没什么问题
    Point * pt2 = nullptr;
    pt2->print();
    pt2->display();
}

int main()
{
    test();
    return 0;
}

